<?php 
/**
 * Concept: Category content setup
 * Copyright 2011 www.gradientpixels.ca
 * Theme: Incantation
 */

get_header(); ?>

<?php			
	$bloglayout = of_get_option('blog_layout');
		switch ($bloglayout) {
		case "left": // with left sidebar ?>
			
<div id="content-wrapper" class="clearfix" >
	<div class="w960 padding55">		
		<?php get_template_part( 'inc/sidebar-blog-left'); ?>			
		<div id="content-right" role="main">
				<section id="primary">
					<?php if ( have_posts() ) : ?>
						<header class="page-header">
							<h1 class="page-title"><?php printf( __( 'Welcome to the %s Category', 'gp' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>
							<?php
								$category_description = category_description();
								if ( ! empty( $category_description ) )
									echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
							?>
						</header>
						
						<?php while ( have_posts() ) : the_post(); // start the loop ?>					
							<?php get_template_part( 'content', 'blog' ); ?>			
						<?php endwhile; ?>
				
<?php if(function_exists('wp_pagenavi')) { // if PageNavi is activated ?>
	<?php wp_pagenavi(); // Use PageNavi ?>
<?php } else { // Otherwise, use traditional Navigation ?>
	<?php gp_content_nav( 'nav-below' ); ?> 
<?php } // End if-else statement ?>

						<?php else : ?>
						
						<article id="post-0" class="post no-results not-found">
							<header class="entry-header">
								<h1 class="entry-title"><?php _e( 'Nothing Found', 'gp' ); ?></h1>
							</header><!-- .entry-header -->
		
							<div class="entry-content">
								<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'gp' ); ?></p>
								<?php get_search_form(); ?>
							</div><!-- .entry-content -->
						</article><!-- #post-0 -->
		
					<?php endif; ?>
				</section>				
		</div><!-- #content-right -->				
	</div><!-- .w960 -->
</div><!-- #content-wrapper -->	
			
			<?php 
			break;
		case "full": // full width ?>

<div id="content-wrapper" class="clearfix" >
		<div class="w960 padding55">
			<div id="content-main" role="main">
				<section id="primary">
					<?php if ( have_posts() ) : ?>
						<header class="page-header">
							<h1 class="page-title"><?php printf( __( 'Welcome to the %s Category', 'gp' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>
							<?php
								$category_description = category_description();
								if ( ! empty( $category_description ) )
									echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
							?>
						</header>
						
						<?php while ( have_posts() ) : the_post(); // start the loop ?>					
							<?php get_template_part( 'content', 'blog' ); ?>			
						<?php endwhile; ?>
				
<?php if(function_exists('wp_pagenavi')) { // if PageNavi is activated ?>
	<?php wp_pagenavi(); // Use PageNavi ?>
<?php } else { // Otherwise, use traditional Navigation ?>
	<?php gp_content_nav( 'nav-below' ); ?> 
<?php } // End if-else statement ?>

						<?php else : ?>
						
						<article id="post-0" class="post no-results not-found">
							<header class="entry-header">
								<h1 class="entry-title"><?php _e( 'Nothing Found', 'gp' ); ?></h1>
							</header><!-- .entry-header -->
		
							<div class="entry-content">
								<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'gp' ); ?></p>
								<?php get_search_form(); ?>
							</div><!-- .entry-content -->
						</article><!-- #post-0 -->
		
					<?php endif; ?>
				</section>				
			</div><!-- #content-main -->				
		</div><!-- .w960 -->
</div><!-- #content-wrapper -->

			<?php 
			break;
		case "right": // with right sidebar ?>

<div id="content-wrapper" class="clearfix" >
	<div class="w960 padding55">
		<div id="content-left" role="main">
				<section id="primary">
					<?php if ( have_posts() ) : ?>
						<header class="page-header">
							<h1 class="page-title"><?php printf( __( 'Welcome to the %s Category', 'gp' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>
							<?php
								$category_description = category_description();
								if ( ! empty( $category_description ) )
									echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
							?>
						</header>
						
						<?php while ( have_posts() ) : the_post(); // start the loop ?>					
							<?php get_template_part( 'content', 'blog' ); ?>			
						<?php endwhile; ?>
				
<?php if(function_exists('wp_pagenavi')) { // if PageNavi is activated ?>
	<?php wp_pagenavi(); // Use PageNavi ?>
<?php } else { // Otherwise, use traditional Navigation ?>
	<?php gp_content_nav( 'nav-below' ); ?> 
<?php } // End if-else statement ?>

						<?php else : ?>
						
						<article id="post-0" class="post no-results not-found">
							<header class="entry-header">
								<h1 class="entry-title"><?php _e( 'Nothing Found', 'gp' ); ?></h1>
							</header><!-- .entry-header -->
		
							<div class="entry-content">
								<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'gp' ); ?></p>
								<?php get_search_form(); ?>
							</div><!-- .entry-content -->
						</article><!-- #post-0 -->
		
					<?php endif; ?>
				</section>
		</div><!-- #content-left -->			
		<?php get_template_part( 'inc/sidebar-blog-right'); ?>				
	</div><!-- .w960 -->
</div><!-- #content-wrapper -->

			<?php
			break;
		}			
?>	

<?php get_footer(); ?>